﻿// Write an if statement that examines two integer variables and exchanges their values if the first one is 
// greater than the second one.

using System;

class Program
{
    static void Main()
    {
        Console.Write("Enter your first number : ");
        string numberStr1 = Console.ReadLine();
        int number1;
        while (!int.TryParse(numberStr1, out number1))
        {
            Console.Write("Invalid input. Please, enter your first number again : ");
            numberStr1 = Console.ReadLine();
        }

        Console.Write("Enter your second number : ");
        string numberStr2 = Console.ReadLine();
        int number2;
        while (!int.TryParse(numberStr2, out number2))
        {
            Console.Write("Invalid input. Please, enter your second number again : ");
            numberStr2 = Console.ReadLine();
        }

        if (number1 > number2)
        {
            int temp = 0;
            temp = number2;
            number1 = number2;
            number2 = temp;
            Console.WriteLine("The values of the numbers are exchanged.");
        }
        else
        {
            Console.WriteLine("The values of the numbers are not exchanged.");
        }
    }
}
